﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ShowTime_Empoyee.aspx.cs" Inherits="EmployeeCheckIn.WebForm3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .TALeft
        {
            text-align: center;
        }
        .button
        {
            font-family: Arial, sans-serif;
            font-size: 12px;
            font-weight: bold;
            width: 65px;
            height: 23px;
        }
        
        .button:hover
        {
            border: solid 0px white;
            font-family: Arial, sans-serif;
            font-size: 12px;
            font-weight: bold;
            color: White;
            width: 65px;
            height: 23px;
        }
        .style1
        {
            width: 93%;
            height: 91px;
        }
        .style9
        {
            height: 28px;
            padding: 20px;
        }
        .style11
        {
            height: 10px;
        }
        .style12
        {
            width: 27px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="style1" align="center">
        <tr>
            <td align="left" class="style9">
                <asp:Label ID="Label1" runat="server" Font-Size="Large" Text="จัดการเวลาพนักงาน"
                    ForeColor="Black"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="center" class="style11">
                <table style="width: 100%;">
                    <tr>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="จากวันที่ :"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox1" runat="server" class="dateInput" Height="24px" Width="140px"
                                onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }" onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="ถึง"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox2" runat="server" class="dateInput" Height="24px" Width="140px"
                                onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }" onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Label_sert" runat="server" Text="รหัสพนักงาน/ชื่อ"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox3" runat="server" Height="24px" Width="140px" onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }"
                                onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="ค้นหา" OnClick="Button1_Click" Width="50px" />
                            <asp:Button ID="Button2" runat="server" Text="รายงาน " OnClick="Button2_Click" Width="60px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="Button3" runat="server" Text="เพิ่มเวลาพนักงาน" Width="120px" OnClick="Button3_Click" />
                        </td>
                        <td align="center" colspan="5">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Label ID="lb_warn" runat="server" Font-Size="Small" ForeColor="Red" Text="----------ไม่พบข้อมูลการค้นหา----------"
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="Export Excel" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                <br />
                <asp:GridView ID="GridView1" CssClass="gv" runat="server" Width="100%" AutoGenerateColumns="False"
                    CellPadding="3" CaptionAlign="Top" OnRowCommand="GridView1_RowCommand" EnableModelValidation="True"
                    OnRowCreated="GridView1_RowCreated" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                    BorderWidth="1px">
                    <Columns>
                        <asp:BoundField DataField="EMP_CODE" HeaderText="รหัสพนักงาน" />
                        <asp:BoundField DataField="EMP_FIRSTNAME" HeaderText="ชื่อ" />
                        <asp:BoundField DataField="EMP_LASTNAME" HeaderText="นามสกุล" />
                        <asp:BoundField DataField="CHECK_IN" HeaderText="วันที่" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-CssClass="TALeft" />
                        <asp:BoundField DataField="timeonlyin" HeaderText="เวลาเข้างาน" ItemStyle-CssClass="TALeft">
                            <ItemStyle CssClass="TALeft"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="timeonlyout" HeaderText="เวลาออกงาน" ItemStyle-CssClass="TALeft">
                            <ItemStyle CssClass="TALeft"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="LATE_TIME" HeaderText="สาย(นาที)" ItemStyle-CssClass="TALeft">
                            <ItemStyle CssClass="TALeft"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField ItemStyle-CssClass="TALeft">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageEdit" runat="server" Height="25px" ImageUrl="~/Immages/icon/edit.png"
                                    ToolTip="แก้ไขข้อมูล" Width="25px" CommandArgument='<%#Eval("EMP_ID")+";"+Eval("EMP_FIRSTNAME")+";"+Eval("EMP_LASTNAME")+";"+Eval("CHECK_IN")+";"+Eval("timeonlyin")+";"+Eval("timeonlyout")+";"+Eval("EMP_CODE")%>'
                                    CommandName="cmdEdit" />
                                <asp:ImageButton ID="ImageDelete" runat="server" Height="25px" Width="25px" CommandName="cmdDel"
                                    ToolTip="ลบข้อมูล" CommandArgument='<%#Eval("EMP_ID")+";"+Eval("EMP_FIRSTNAME")+";"+Eval("EMP_LASTNAME")+";"+Eval("CHECK_IN")+";"+Eval("timeonlyin")+";"+Eval("timeonlyout")+";"+Eval("EMP_CODE")%>'
                                    OnClientClick="if(!confirm('ยืนยันการลบข้อมูล')) return false;" ImageUrl="~/Immages/icon/button_cancel.png" />
                                <asp:ImageButton ID="ImageGviewSum" runat="server" Height="25px" CommandName="cmdSum"
                                    ToolTip="รายงาน" CommandArgument='<%#Eval("EMP_FIRSTNAME")%>' ImageUrl="~/Immages/icon/SumTime.png"
                                    Width="25px" />
                            </ItemTemplate>
                            <ItemStyle CssClass="TALeft"></ItemStyle>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="left" class="style9">
                <asp:HiddenField ID="HidPenalty" runat="server" />
                <asp:HiddenField ID="HidLateTime" runat="server" />
            </td>
        </tr>
    </table>
</asp:Content>
